package com.qfedu.food.vo;

import lombok.Data;

@Data
public class R {
    private int code;
    private String msg;
    private Object data;

    public R(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public R() {
    }

    public static R setR(int c,String m,Object o){
        return new R(c,m,o);
    }
    /**
     * 成功*/
    public static R ok(){
        return  setR(1,"OK",null);
    }
    /**
     * 成功 返回数据*/
    public static R ok(Object obj){
        return  setR(1,"OK",obj);
    }
    /**
     * 失败*/
    public static R fail(){
        return setR(2,"FAIL",null);
    }
    /**
     <<<<<<< HEAD
     * 失败 返回内容*/
    public static R fail(String m){
        return setR(2,m,null);
    }
}
